package com.example.book_libapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener{

	private Button btn_login;
	private Button btn_register;
	private Button btn_passforg;
	private Button btn_home;
	private Button btn_booklistv;
	private Button btn_booksearch;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        btn_login = (Button)findViewById(R.id.BtnLogin);
        btn_login.setOnClickListener(this);
        btn_register = (Button) findViewById(R.id.BtnRegister);
        btn_register.setOnClickListener(this);
        btn_passforg = (Button)findViewById(R.id.BtnForg);
        btn_passforg.setOnClickListener(this);
        btn_home = (Button)findViewById(R.id.HomePage);
        btn_home.setOnClickListener(this);
        btn_booklistv = (Button) findViewById(R.id.BooklistView);
        btn_booklistv.setOnClickListener(this);
        btn_booksearch = (Button) findViewById(R.id.btnsearch);
        btn_booksearch.setOnClickListener(this);
        
        
    }
    
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (v == btn_login){
		Intent i = new Intent(this, Login.class);
		startActivity(i);
		}
		else if(v == btn_register)
		{
			Intent i = new Intent(this, Register.class);
			startActivity(i);
		}
		else if(v == btn_passforg) {
			Intent i = new Intent(this, Passforg.class);
			startActivity(i);
		}
		else if(v == btn_home){
			Intent i = new Intent(this, BookGridView.class);
			startActivity(i);
		}
		else if(v == btn_booklistv){
			Intent i = new Intent(this, ListViewBookActivity.class);
			startActivity(i);
		}
		else if(v == btn_booksearch){
			Intent i = new Intent(this, Booksearch.class);
			startActivity(i);
		}
	}
}